package R.Service;

import R.Dao.SickDao;
import R.Entity.Diagnosis;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "MinuteServlet", value = "/minute")
public class MinuteServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        String card_number = request.getParameter("card_number");//就诊卡号
        String record_number = request.getParameter("record_number");//病历编号
        Diagnosis d=new Diagnosis();
        d.setCard_number(card_number);
        d.setRecord_number(record_number);
        Diagnosis b= SickDao.getD(d);
        HttpSession session=request.getSession();
        session.setAttribute("minute",b);
        response.sendRedirect("/R/minute.jsp");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
